BigDFT.Interop.MRChemInterop module

This module contains some wrappers for using MRChem to perform calculations.

https://mrchem.readthedocs.io/en/latest/index.html

Input files are defined using the json format as a dictionary.

https://mrchem.readthedocs.io/en/latest/users/program_json.html

class MRChemLogfile(logname)[source]

This class stores the detailed output from MRChem.

energy

the energy of the system

Type:

float

property energy

The total energy of the system.

class MRChemCalculator(omp='1', mpi_run='', dry_run=False, skip=False, verbose=True)[source]

A calculator that drives MRChem calculations through the command line.

This calculator will look in the environment for the following variables: * OMP_NUM_THREADS : number of threads to use * MRCHEM_MPIRUN : the mpi command you want to launch mrchem with * MRCHEM_ROOT : the directoy that contains the mrchem executable.

os = <module 'os' from '/usr/local/anaconda/lib/python3.7/os.py'>
pre_processing()[source]

Process local run dictionary to create the input directory and identify the command to be passed

Returns:

dictionary containing the command to be passed to process_run()

Return type:

dict

process_run(command)[source]

Run the MRChem executable.

post_processing(logname, command)[source]

Post processing the calculation.

Returns:

a representation of the detailed output.

Return type:

(BigDFT.Interop.MRChemLogfile)

_example()[source]

The following is an example of module usage:

"""Example of using MRChem interoperability"""
from BigDFT.IO import XYZReader
from BigDFT.Systems import System
from BigDFT.Fragments import Fragment
from os.path import join
from os import getcwd
from copy import deepcopy

# Create a system.
reader = XYZReader("He")
fsys = System()
fsys["FRA:1"] = Fragment(xyzfile=reader)
fsys["FRA:2"] = deepcopy(fsys["FRA:1"])
fsys["FRA:2"].translate([-4, 0, 0])

# Create an input file
inp = {}
inp["WaveFunction"] = {"method": "PBE"}
inp["world_prec"] = 1.0e-2

# Create a Calculator and Run
calc = MRChemCalculator(mpi_run="mpirun -np 1")
log = calc.run(sys=fsys, input=inp, name="HE2", run_dir="scratch")

# The full set of data from the json output are available
log["output"]